<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Phone {
            //构造方法
            constructor(brand, price) {
                this.brand = brand;
                this.price = price;
            }
            //父类的成员属性
            call() {
                console.log('我打打打电话!!!!!!!!');
            }
        }

        class SmartPhone extends Phone {
            constructor(brand, price, color, size) {
                super(brand, price);//phone.call(this,brand,price)
                this.color = color;
                this.size = size;
            }

            call() {//这是对子类对父类方法的重写
                console.log('我视频通话！！');
            }
            phone() {
                console.log('拍照照片');
            }
            playGame() {
                console.log('玩玩玩游戏嘻嘻嘻嘻');
            }
        }
        const xiaomi = new SmartPhone('小米', 799, '黑色', '4.7inch');
        console.log(xiaomi);
        xiaomi.call();
        xiaomi.phone();
        xiaomi.playGame();
        console.log(xiaomi.__proto__);





    </script>
</body>

</html>